package com.elh.jpa.dao;

import cn.hutool.core.util.IdUtil;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentityGenerator;
import org.hibernate.id.UUIDGenerator;
import org.springframework.stereotype.Component;

import java.io.Serializable;

//@Component
public class CustomIDGenerator extends UUIDGenerator {


    @Override
    public Serializable generate(SharedSessionContractImplementor session, Object object) {
        return IdUtil.simpleUUID();
    }


}